﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace _05.BiggerNeighborsTest
{
    [TestClass]
    public class BiggerNeighborsTest
    {
        [TestMethod]
        public void TestMethodEmptyArray()
        {
            int[] array = { };
            bool result = BiggerNeighbors.IsBiggerThanNeighbors(0, array);
            Assert.IsFalse(result);
        }

        [TestMethod]
        public void TestMethodOneElementArray()
        {
            int[] array = { 1 };
            bool result = BiggerNeighbors.IsBiggerThanNeighbors(1, array);
            Assert.IsTrue(result);
        }

        [TestMethod]
        public void TestMethodFirstPositionTrue()
        {
            int[] array = { 3, 2, 3, 2, 1 };
            bool result = BiggerNeighbors.IsBiggerThanNeighbors(0, array);
            Assert.IsTrue(result);
        }

        [TestMethod]
        public void TestMethodFirstPositionFalse()
        {
            int[] array = { 1, 2, 3, 2, 1 };
            bool result = BiggerNeighbors.IsBiggerThanNeighbors(0, array);
            Assert.IsFalse(result);
        }

        [TestMethod]
        public void TestMethodLastPositionTrue()
        {
            int[] array = { 3, 2, 3, 2, 3 };
            bool result = BiggerNeighbors.IsBiggerThanNeighbors(array.Length - 1, array);
            Assert.IsTrue(result);
        }

        [TestMethod]
        public void TestMethodLasttPositionFalse()
        {
            int[] array = { 1, 2, 3, 2, 1 };
            bool result = BiggerNeighbors.IsBiggerThanNeighbors(array.Length - 1, array);
            Assert.IsFalse(result);
        }

        [TestMethod]
        public void TestMethodMiddlePositionTrue()
        {
            int[] array = { -1, 0, 2, 3, -3, 1, 0 };
            bool result = BiggerNeighbors.IsBiggerThanNeighbors(3, array);
            Assert.IsTrue(result);
        }

        [TestMethod]
        public void TestMethodMiddlePositionFalse()
        {
            int[] array = { -1, 0, -4, -3, -3, 1, 0 };
            bool result = BiggerNeighbors.IsBiggerThanNeighbors(3, array);
            Assert.IsFalse(result);
        }
    }
}